home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-07-15 | 1.3 KB | 46 lines | [TEXT/MPS ] |
- unit histogramUnit;
-
- { Copyright © G. Sawitzki, StatLab Heidelberg }
-
- interface
-
- uses types;
- {$Setc paranoia=true} {test for conditions which simply should not happen.}
-
- const
- {maxclass = 127; } {maximum class in histogram. must be odd}
- maxclass = 63; {cells are 0..maxclass}
-
- type
- histtype = record
- count : longint; {total number of observations in histogram}
- maxbincount : longint; {maximum number of observations in one bin}
- binwidth : extended;{equidistant. not yet defined: inf.}
- min, max : extended;{min and max for histogram (not data)}
- {cells are left=min+i*binwidth< x ≤right=min+(i+1)*binwidth. }
- {right end needs to be included to allow calculation of distribution function}
- cnt: array[0..maxclass] of longint;
- id: str15;
- end;
-
- tStatType = record
- count: longint;
- mean: extended;
- ssq: extended;
- min, max: extended;
- id: str15;
- end;
-
- procedure initStat(var stat:tStatType;name:str15);
- procedure addstat (w: extended; var stat: tStatType);
-
- procedure addbistat (x, y: extended; var xstat, ystat: tStatType; var xyssq: extended);
-
-
- procedure initHistogram (var hist: histtype;name:str15);
- procedure addhist (val: extended; var hist: histtype);
- function histogramcell(val: extended; var hist: histtype):integer;
-
- implementation
- {$I histogramunit.inc}
- end.